<?php $this->_extends('_layouts/framework_layout'); ?>

<?php $this->_block('title'); ?> - 主机管理<?php $this->_endblock(); ?>
<?php $this->_block('conpno'); ?><?php echo $pageno;?><?php $this->_endblock(); ?>

<?php $this->_block('inits'); ?>
<script type="text/javascript" src="<?php echo $_BASE_DIR; ?>scripts/mocha-init.js"></script>
<?php $this->_endblock(); ?>

<?php $this->_block('contents'); ?>

	<div id="getting-started">
 
		<table>
		<tr><td>主机组名</td><td>描述</td><td>创建时间</td><td>已连接主机数</td><td>总主机数</td><td>操作</td></tr>
		<?php foreach ($group as $s): ?>
		<tr><td><?php echo $s->groupname;?></td><td><?php echo $s->description;?></td><td><?php echo $s->datetime;?></td><td>0</td><td>2</td><td>
		 <a href="<?php echo url('default::hostmanage/view', array('group_id' => $s->id())); ?>">详情</a>
            <a href="<?php echo url('default::hostmanage/edit', array('group_id' => $s->id())); ?>">编辑</a>
            <a href="<?php echo url('default::hostmanage/refreshgroup', array('group_id' => $s->id())); ?>">刷新主机数</a>
            <a href="<?php echo url('default::hostmanage/del', array('group_id' => $s->id())); ?>">删除</a>
            <a href="<?php echo url('default::hostlist/index', array('groupid' => $s->id())); ?>">添加主机</a> <a href="<?php echo url('default::hostlist/state', array('groupid' => $s->id())); ?>">查看主机状态</a>
		<?php echo $s->id;?></td></tr>
		<?php endforeach; ?>
		<tr>
      <td colspan="4"> <a href="<?php echo url('default::hostmanage/manage', array('page' => $pager['first'],'searchtxt' => $stxt)); ?>" title='首页'>首页</a>
      <?php if($pager['prev']!=$pager['current']) {?>
      <a href="<?php   echo url('default::hostmanage/manage', array('page' => $pager['prev'],'searchtxt' => $stxt)); ?>" title='上一页'>上一页</a>
      <?php } ?>
      <?php if($pager['last']!=$pager['current']) {?>
       <a href="<?php echo url('default::hostmanage/manage', array('page' => $pager['next'],'searchtxt' => $stxt)); ?>" title='下一页'>下一页</a>
       <?php } ?>
       <?php if($pager['record_count']>$pager['page_size']) {?>
       <a href="<?php echo url('default::hostmanage/manage', array('page' => $pager['last'],'searchtxt' => $stxt)); ?>" title='末页'>尾页</a>
       <?php } ?>
       共有 <font color="Red"><?php echo $pager['record_count'];?></font> 条记录,分为 <font color="Red"><?php echo $pager['page_count'];?></font> 页显示,当前第 <font color="Red"><?php echo $pager['current'];?></font>页,每页 <font color="Red"><?php echo $pager['page_size'];?></font> 条
    </td>
    </tr>
		</table>
	</div>

<?php $this->_endblock('contents'); ?>